
package online.yysh.charging;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;

public class TestActivity extends AppCompatActivity {
    private ImageView iv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
        iv = findViewById(R.id.iv);

        AnimationDrawable animationDrawable = (AnimationDrawable) iv.getBackground();
        if (!animationDrawable.isRunning()){
            animationDrawable.start();
        }
    }
}